var x = 10;
function a(y) {
    var x = 20;
    return b(y);
}

function b(y) {
    return x + y
}

var x = a(20);
console.log(x);


setTimeout(function () {
    console.log('abc')

    // setTimeout(function)
}, 1000)


console.log('aaaaa')
sleep()
console.log('bbbbbb')
function sleep() {
    var stop = true;
    while (stop) {
        if (!a) {

        }
        var a = setTimeout(function () {
            stop = false
            return 'gogogo'
        }, 1000)
    }
}

new Promise((resolve, reject) => {
    setTimeout(function () {
        console.log('aaa')

        resolve(1)
    }, 3000)
}).then(setTimeout(function () {
    // res(1)
    console.log('abbbbbbaa')

}, 1000))
for (let i = 0; i < 4; i++) {

}
function yanshi(func, arg) {
    setTimeout(function () {
        func.apply(this, arg)
    }, 1000)
}

for (var i = 0; i < 5; i++) {
    // var a = (i) => setTimeout(() => console.log(i), 1000)
    // a(i)

    try {
        throw i
    } catch (i) {
        setTimeout(() => { console.log(i); }, 1000)
    }
}
/**
 * 
 * @returns await func
 */
var sleep = function () {
    return new Promise(res => {
        setTimeout(res, 3000)
    })
}
async function cc() {
    for (let i = 0; i < 5; i++) {
        await sleep()
        console.log(i);
    }
}
cc()

var arr = []
var out = function () {
    new Promise(res => {
        setTimeout(function () { }, 1000)
    })
}


for ()